home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Modem / DPX496 < prev    next >
Text File  |  1994-10-19  |  7KB  |  303 lines

  1. ! "Dataplex DPX 496 14/7/92" gtw
  2. !    based on JFK’s “Telebit 3000” script
  3. ! and ISL's “Zoom TurboModem” script.
  4. !
  5. ! 14/07/92 gtw - Started
  6. !
  7. ! Cable needed for the Telebit T3000.
  8. !  Din-8    DB-25
  9. ! 1 (DTR)   4,20 (RTS, DTR)
  10. ! 2 (CTS)   5 (CTS) ** Note, normally 2(CTS)->6 (DSR) on other mac cables.
  11. ! 3 (TxD-)  2 (TD)
  12. ! 4 (SG)    7 (SG)
  13. ! 5 (RxD-)  3 (RD)
  14. ! 6 (TxD+)  Not Connected
  15. ! 7 (GPi)   8 (DCD)
  16. ! 8 (RxD+)  7 (SG)
  17. !  
  18. @ORIGINATE
  19. @ANSWER
  20. !
  21. ! Talk to the modem at 19,200 bps.  the T3000 should auto-baud this
  22. ! unless the user has locked the port to a particular speed.  If it
  23. ! is locked to a different speed, the user will need to change that.
  24. !
  25. serreset 19200, 0, 8, 1
  26. hsreset 0 1 0 0 0 0 
  27. !setspeed 1440
  28. !
  29. ! First recall the factory configuration
  30. ! F is the built in preconfigured setting for CTS/RTS handshaking.
  31. ! Since it's possible for the user to modify F0 parameters, this is a 
  32. ! little safer.
  33. !
  34. ! AT &F &C1 &K2 &D2 sets:
  35. ! &C1 - DCD follows state of the remote data carrier
  36. ! &K2 - Enable RTS/CTS flow control, XON-XOFF ignored
  37. ! &R2  - CTS tracks RTS
  38. ! &D2  - DTR on/off disconnects
  39. !
  40. settries 0
  41. matchclr
  42. @LABEL 1
  43. matchstr 1 2 "OK\13\10"
  44. write "AT &F &C1 &K2 &D2\13"
  45. matchread 30
  46. inctries
  47. iftries 2 119
  48. ! Modem is not responding, reset and send a break
  49. DTRClear
  50. pause 5
  51. DTRSet
  52. SBreak
  53. jump 1
  54. !
  55. ! Next, Set up the configuration: drop connection after losing DTR
  56. !    Turn off auto answer and command echo.
  57. !
  58. ! &D3 - DTR on/off resets modem 
  59. ! S0=0 - Don't answer calls
  60. ! E0 - Turn command echo off
  61. @LABEL 2
  62. matchclr
  63. pause 5
  64. matchstr 1 3 "OK\13\10"
  65. write "AT &D3 S0=0 E0\13"
  66. matchread 30
  67. jump 119
  68. !
  69. ! Next, disable MNP and error control
  70. ! turn on internal buffering (for V.32bis),
  71. ! and extended result codes 
  72. ! CTS/RTS flow control was set when we
  73. ! issued &K2, so we don't need to do it here.
  74. !
  75. ! &E0 - Turn off all error detection/correction (ARA does MNP and
  76. !          compression itself.  It needs these turned off in the modem).
  77. ! *E0 - Kill compression.
  78. ! %V0 - Turn on trellis encoding
  79. ! %H3 - Attempt a turbo conenction, then try all others in descending order
  80. ! V1 - Issue extended result codes.  This will display busy, connect XXX, etc.
  81. !      The modem will say "CARRIER XXX"  Where XXX is the line speed (as opposed to
  82. !      DTE speed).  We need this so we can tell ARA what speed we are really 
  83. !      communicating at (for timing).
  84. !
  85. @LABEL 3
  86. pause 5
  87. matchstr 1 4 "OK\13\10"
  88. write "AT *E0 %V0 %H3 V1\13"
  89. matchread 30
  90. jump 119
  91. !
  92. ! If speaker on flag is true, jump to label 8.  Else turn off the speaker
  93. !
  94. @LABEL 4
  95. ifstr 2 5 "1"
  96. pause 5
  97. matchstr 1 5 "OK\13\10"
  98. write "AT M0 \13"
  99. matchread 30
  100. jump 119
  101. !
  102. ! The modem is ready so enable answering, or originate a call
  103. !
  104. @LABEL 5
  105. pause 5
  106. ifANSWER 30
  107. note "Dialing ^1" 3
  108. write "ATDP^1\13"
  109. !
  110. @LABEL 6
  111. matchstr 1  51 "CONNECT 1200\13\10"
  112. matchstr 2  52 "CONNECT 2400\13\10"
  113. matchstr 3  53 "CONNECT 4800\13\10"
  114. matchstr 4  54 "CONNECT 7200\13\10"
  115. matchstr 5  55 "CONNECT 9600\13\10"
  116. matchstr 6  56 "CONNECT 12000\13\10"
  117. matchstr 7  57 "CONNECT 14400\13\10"
  118. matchstr 8  58 "CONNECT 19200\13\10"
  119. matchstr 9  121 "NO CARRIER\13\10"
  120. matchstr 10 121 "ERROR\13\10"
  121. matchstr 11 120 "NO DIALTONE\13\10"
  122. matchstr 12 122 "BUSY\13\10"
  123. matchstr 13 123 "NO ANSWER\13\10"
  124. matchstr 14  122 "BLACKLIST\13\10"
  125. matchstr 15  122 "FORBIDDEN CALL\13\10"
  126. matchread 700
  127. jump 119
  128. !
  129. ! Notice that all we do for different connect speeds is issue a 
  130. ! "CommunicatingAt" command.  Remember, we locked the interface speed
  131. ! to 14,400 bps so we don't want to reset the serial speed after we connect.
  132. ! CommuicatingAt tells ARA what the actual line speed is so that it
  133. ! can set it's timers appropriately.  I guess your performance would be
  134. ! sub-optimal if you don't set this...
  135. !
  136. @LABEL 51
  137. note "Communicating at 1200 bps." 2
  138. CommunicatingAt 1200
  139. jump 15
  140. !
  141. @LABEL 52
  142. note "Communicating at 2400 bps." 2
  143. CommunicatingAt 2400
  144. jump 15
  145. !
  146. @LABEL 53
  147. note "Communicating at 4800 bps." 2
  148. CommunicatingAt 4800
  149. jump 15
  150. !
  151. @LABEL 54
  152. note "Communicating at 7200 bps." 2
  153. CommunicatingAt 7200
  154. jump 15
  155. !
  156. @LABEL 55
  157. note "Communicating at 9600 bps." 2
  158. CommunicatingAt 9600
  159. jump 15
  160. !
  161. @LABEL 56
  162. note "Communicating at 12000 bps." 2
  163. CommunicatingAt 12000
  164. jump 15
  165. !
  166. @LABEL 57
  167. note "Communicating at 14400 bps." 2
  168. CommunicatingAt 14400
  169. jump 15
  170. !
  171. @LABEL 58
  172. note "Communicating at 19200 bps." 2
  173. CommunicatingAt 19200
  174. jump 15
  175. !
  176. ! Set CTS handshaking ON in the serial port (that's the 1 in the HSReset
  177. ! command below )
  178. !
  179. @LABEL 15
  180. HSReset 0 1 0 0 0 0 
  181. ifANSWER 16
  182. pause 30
  183. @LABEL 16
  184. exit 0
  185. !
  186. ! @ANSWER
  187. ! Set up the modem to answer
  188. !
  189. @LABEL 30
  190. write "ATS0=1\13"
  191. matchstr 1 31 "OK\13\10"
  192. matchread 30
  193. jump 119
  194. !
  195. @LABEL 31
  196. matchstr 1  32 "RING\13\10"
  197. matchstr 1  51 "CONNECT 1200\13\10"
  198. matchstr 2  52 "CONNECT 2400\13\10"
  199. matchstr 3  53 "CONNECT 4800\13\10"
  200. matchstr 4  54 "CONNECT 7200\13\10"
  201. matchstr 5  55 "CONNECT 9600\13\10"
  202. matchstr 6  56 "CONNECT 12000\13\10"
  203. matchstr 7  57 "CONNECT 14400\13\10"
  204. matchstr 8  58 "CONNECT 19200\13\10"
  205. matchstr 9  121 "NO CARRIER\13\10"
  206. matchstr 10 121 "ERROR\13\10"
  207. matchstr 11 120 "NO DIALTONE\13\10"
  208. matchstr 12 122 "BUSY\13\10"
  209. matchstr 13 123 "NO ANSWER\13\10"
  210. matchstr 14  122 "BLACKLIST\13\10"
  211. matchstr 15  122 "FORBIDDEN CALL\13\10"
  212. matchread 700
  213. jump 31
  214. !
  215. @LABEL 32
  216. userhook 1
  217. note "Answering phone..." 2
  218. jump 31
  219. !
  220. ! 50: error messages
  221. !
  222. @LABEL 119
  223. exit -6019
  224. !
  225. @LABEL 120
  226. exit -6020
  227. !
  228. @LABEL 121
  229. exit -6021
  230. !
  231. @LABEL 122
  232. exit -6022
  233. !
  234. @LABEL 123
  235. exit -6023
  236. !
  237. ! Hang up the modem
  238. !
  239. @HANGUP
  240. @LABEL 60
  241. settries 0
  242. @LABEL 61
  243. matchclr
  244. matchstr 1 63 "NO CARRIER\13\10"
  245. matchstr 2 63 "OK\13\10"
  246. matchstr 3 63 "ERROR\13\10"
  247. write "ATH\13"
  248. matchread 30
  249. inctries
  250. iftries 3 63
  251. ! no response, try escape sequence
  252. matchclr
  253. matchstr 1 62 "OK\13\10"
  254. write "+++"
  255. matchread 15
  256. !
  257. ! No Response from modem, toggle DTR
  258. !
  259. DTRClear
  260. pause 5
  261. DTRSet
  262. jump 61
  263. !
  264. @LABEL 62
  265. ! Pause 1 second before to ensure we meet the escape time delay
  266. pause 10
  267. Flush
  268. matchstr 1 63 "OK\13\10"
  269. matchstr 2 63 "NO CARRIER\13\10"
  270. matchstr 3 63 "ERROR\13\10"
  271. write "ATH\13"
  272. matchread 30
  273. jump 61
  274. !
  275. !
  276. ! recall the factory settings.  Use &F &C1 &K2 &D2  again (see note at top of script)
  277. !
  278. @LABEL 63
  279. matchclr
  280. matchstr 1 64 "OK\13\10"
  281. pause 15
  282. write "AT &F &C1 &K2 &D2\13"
  283. matchread 30
  284. !
  285. ! Turn off auto answer, set S51 so modem will check interface
  286. ! speed on next connection.  If you don't do this, the modem
  287. ! will not try to autobaud, with the result being it exits the 
  288. ! script with an error
  289. ! \\N3 %C1 S48=7  - Negotiate conenction
  290. ! S0=0 - Don't try to answer the phone
  291. !
  292. @LABEL 64
  293. pause 5
  294. matchstr 1 65 "OK\13\10"
  295. write "AT S0=0\13"
  296. matchread 20
  297. !
  298. @LABEL 65
  299. exit 0
  300.  
  301.